package cn.zhizihua.service.impl;

import cn.zhizihua.domain.po.Address;
import cn.zhizihua.domain.po.User;
import cn.zhizihua.domain.query.AddressQuery;
import cn.zhizihua.domain.query.BaseQuery;
import cn.zhizihua.domain.vo.ResultBean;
import cn.zhizihua.mapper.AddressMapper;
import cn.zhizihua.service.IAddressService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhizihua
 * @since 2024-12-11
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService {

    @Autowired
    AddressMapper addressMapper;

    @Override
    public List<Address> getByUserId(Integer uid) {
        List<Address> addressList = addressMapper.selectList(new QueryWrapper<Address>().eq("userId", uid));
        return addressList;
    }
}
